package com.yxhl.zoume.core.tripsmgmt.info;

/**
 * Created by sugarya on 16/4/6.
 */
public enum PayStatus {

    CREATED(1, "已下单"), PAID(2, "已支付"), INVALID(3, "已失效"),
    REFUNDING(4, "退票中"), REFUND(5, "已退票"), FINISH(6, "去评价"),
    CANCEL(7, "已取消"), EXPIRE(8, "已过期");

    private int type;
    private String content;

    PayStatus(int type, String content) {
        this.type = type;
        this.content = content;
    }


    public static String getContentByType(int type) {
        String content = null;
        for (PayStatus status : PayStatus.values()) {
            if (status.getType() == type) {
                content = status.getContent();
            }
        }
        return content;
    }

    public static PayStatus getPayStatusByValue(int type) {
        for (PayStatus status : PayStatus.values()) {
            if (status.getType() == type) {
                return status;
            }
        }
        return CREATED;

    }

    public int getType() {
        return type;
    }

    public String getContent() {
        return content;
    }
}
